<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('setting',$postdata);
		exi('设置成功');
	}
	$footernav = array(
		array('title'=>'股东中心','icon'=>'icon-shouye','color'=>'#cc99ff','action'=>'jy_globonus/index/','image'=>'../addons/jy_weishop/resource/images/jy_weishoparticle.png'),
		array('title'=>'分红明细','icon'=>'icon-caifua','color'=>'#66cc99','action'=>'jy_globonus/bonus/','image'=>'../addons/jy_weishop/resource/images/jy_fenleimsg.png'),
	);
	//$plugins =$this->plugins();
	$return['item']=$this->plugin_setting('setting');	
	$return['item']['plugins']=$return['item']['plugins']?$return['item']['plugins']:$plugins[1]['list'];
	$return['item']['footernav'] = !empty($return['item']['footernav']) ? $return['item']['footernav'] : $footernav;
	$return['feetotal_types']=$this->feetotal_types;
	$return['fenxiaototal_types']=$this->fenxiaototal_types;
	$htmls=array(
		'type'=>'edit',
		'desc'=>'参数设置',
		'tabs'=>$tabs,
		'edit_tab'=>true,
		'edits'=>array(
			array(
				'title'=>'基础设置',
				'list'=>array(
					array('type'=>'radio','title'=>'是否开启全民股东','name'=>'open','options'=>'selfbuy'),
					array('type'=>'radio','title'=>'内购分红','name'=>'selfbuy','options'=>'selfbuy'),
					array('type'=>'switch','title'=>'前端关闭分红池金明细显示','name'=>'no_redfee','isradio'=>1),
					array('type'=>'radio','title'=>'佣金计算方式','name'=>'fenxiaototal_types','options'=>'fenxiaototal_types'),	
					array('type'=>'checkbox','title'=>'计算股东分红','name'=>'feetotal_types','options'=>'feetotal_types'),	
					array('type'=>'link','from'=>'action','title'=>'商城链接','name'=>'shop_action','help'=>'申请股东，返回的商城链接，不填则默认商城首页！'),
				)
			),
			array(
				'title'=>'股东资格',
				'list'=>array(
					array('type'=>'radio','title'=>'成为股东条件','name'=>'become','options'=>'become'),
					array('type'=>'string','title'=>'消费次数达到（次）','name'=>'num','show'=>array('become'=>2)),
					array('type'=>'string','title'=>'消费金额达到（元）','name'=>'money','show'=>array('become'=>3)),
					array('type'=>'radio','title'=>'是否需要审核','name'=>'become_check','options'=>'is'),
					array('type'=>'radio','title'=>'分销商必须完善资料','name'=>'become_reg','options'=>'is'),
					)
			),
			array(
				'title'=>'结算',
				'list'=>array(
					array('type'=>'switch','title'=>'只结算完成的订单？','name'=>'is_status3','isradio'=>1),
					array('type'=>'radio','title'=>'结算周期','name'=>'zhouqi','options'=>'zhouqi'),
					array('type'=>'radio','title'=>'结算方式','name'=>'withdrawtype','options'=>'withdraw'),
					array('type'=>'string','title'=>'默认分红设置','name'=>'rate','help'=>'填写数字表示固定佣金，填写%，表示按百分比计算分红;'),
					array('type'=>'unitstring','unit'=>'%','title'=>'佣金提现手续费（%）','name'=>'withdrawcharge'),
					array('type'=>'radio','title'=>'佣金计算方式','name'=>'commissiontype','options'=>'commissiontype','help'=>'默认方式: 除运费和会员折扣(或促销折扣)外其他所有费用全部计算佣金;实际支付方式: 只计算实际支付和余额抵扣部分的佣金(包括余额支付)'),
					array('type'=>'string','title'=>'免手续费提现区间开始金额','name'=>'withdrawbegin'),
					array('type'=>'string','title'=>'免手续费提现区间结束金额','name'=>'withdrawend','help'=>'当提现手续费金额在此区间内时,不扣除提现手续费. 结束金额 必须大于 开始金额才能生效'),
					array('type'=>'string','title'=>'结算天数','name'=>'day','help'=>'当订单完成后的n天后，佣金才能申请提现,设置0或空，订单完成就可以结算'),			
			),
			),
			array(
				'title'=>'分红考核标准',
				'list'=>array(
					array('type'=>'switch','title'=>'开启考核','name'=>'iskao','isradio'=>1),
					array('type'=>'unitstring','unit'=>'%','title'=>'分红每个月增长（%）','name'=>'kao_rate','help'=>'比如7月份总佣金1000元，8月份总佣金就要1100元，否则无法分红！'),
					array('type'=>'unitstring','unit'=>'元','title'=>'分红满N元','name'=>'kao_feemax','help'=>'当总分红达到N万/月就不再考核增长比例，就算没打标，也有分红'),
					)
			),
			array(
				'title'=>'股东升级',
				'list'=>array(
						array('type'=>'checkbox','title'=>'分销商升级依据','name'=>'level_up_types','options'=>'leveltype'),		
					)
			),
			array(
				'title'=>'股东中心',
				'list'=>array(
					//array('type'=>'radio','title'=>'是否开启商品详情二维码分享','name'=>'qrcodeshare','options'=>'is'),
					array('type'=>'radio','title'=>'会员中心股东中心入口','name'=>'home','options'=>'show'),
					array('type'=>'radio','title'=>'分销中心股东中心入口','name'=>'commission','options'=>'show'),
					array('type'=>'text','title'=>'股东须知','name'=>'notice','help'=>'在股东中心显示'),
								
					)
			),
			
			array(
				'title'=>'样式/文字',
				'list'=>array(
					array('type'=>'image','title'=>'申请头部图片','name'=>'regbg'),
					array('type'=>'string','title'=>'股东中心','name'=>'tcenter','help'=>'为空默认为：股东中心'),
					array('type'=>'string','title'=>'成为股东','name'=>'tbecome','help'=>'为空默认为：成为股东'),
					array('type'=>'string','title'=>'坐享分红自定义','name'=>'tdesc','help'=>'为空默认为：成为股东后，您可以享受平台营业额的N%收益'),					
				)
			),
			array(
							'title'=>'底部导航',
							'list'=>array(
								array('type'=>'array','name'=>'footernav','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
								),
							)
			),
			array(
				'title'=>'申请协议',
				'list'=>array(
					array('type'=>'string','title'=>'协议名称','name'=>'applytitle'),
					array('type'=>'richtext','title'=>'协议内容','name'=>'applycontent'),
					
								
					)
			),
		
		)
	);
	$return['leveltype']=$this->level_up_types;
	$return['withdraw']=array('1'=>'商城余额','2'=>'微信钱包');
	$return['commissiontype']=array('1'=>'默认方式','2'=>'实际支付方式');
	$return['is']=array('0'=>'否','1'=>'是');
	$return['selfbuy']=array('0'=>'关闭','1'=>'开启');
	$return['show']=array('0'=>'不显示','1'=>'显示');
	$return['become']=array('0'=>'无条件','1'=>'申请','2'=>'消费次数','3'=>'消费金额');
	$return['zhouqi']=array('1'=>'按月','2'=>'按周');
	$return['htmls']=$htmls;
	exi($return);
}

